import {
	HTTP
} from '../utils/http.js';

import util from '../utils/util.js';

export class reportMatterModule extends HTTP {
	GetOrganization(neiID) {
		return this.request({
			url: '/api/ReportThing/GetOrganization',
			data: {
				neiID: neiID
			}
		})
	}

	GetEmployee(orgID) {
		return this.request({
			url: '/api/ReportThing/GetEmployee',
			data: {
				orgID: orgID
			}
		})
	}
	
	getHisory() {
		const userData = util.getStorage('userData')
		return this.request({
			url: '/api/ReportThing/GetReportThing',
			data: {
				userID: userData.userID
			}
		})
	}

	postReport(leaderID, matterTxt = '无') {
		const userData = util.getStorage('userData')
		return this.request({
			url: '/api/ReportThing/ReportThing',
			data: {
				userID: userData.userID,
				reptDetails: matterTxt,
				leaderID: leaderID
			}
		})
	}

	postPicture(reptID, list) {
		return this.uploadFile({
			url: '/api/ReportThing/ReptImg',
			files: list,
			formData: {
				"reptID": reptID
			}
		})
	}

	postRecord(reptID, list) {
		return this.uploadFile({
			url: '/api/ReportThing/ReptVoice',
			files: list,
			formData: {
				"reptID": reptID
			}
		})
	}

}
